
#include <iostream>

using namespace std;

class A
{
public:
	virtual void run(int x = 0)
	{
		cout << "this is A x=" << x << endl;
	}
	virtual void run_x0()
	{
		run();
	}
	virtual ~A() = default;
};

class B : public A
{
public:
	virtual void run(int x = 1) override
	{
		cout << "this is B x=" << x << endl;
	}
};

int main()
{
	B b;
	B * pb = &b;
	A * pa = pb;
	pb->run(); // this is B x=1
	pa->run(); // this is B x=0

	pb->run_x0();
	pa->run_x0();

	return 0;
}
